Skip to content

feat: Implement rtransaction builder#34

Merged
wheval merged 3 commits intoancore-org:mainfrom
od-hunter:feat/transaction-builder
Feb 26, 2026
Merged

feat: Implement rtransaction builder#34
wheval merged 3 commits intoancore-org:mainfrom
od-hunter:feat/transaction-builder

Conversation

@od-hunter
Copy link
Contributor

Pull Request: Add Transaction Builder with Stellar SDK v13 Support

Description

This PR implements a new AccountTransactionBuilder class that provides a fluent API for building and submitting Stellar transactions using the updated Stellar SDK v13. The builder pattern simplifies transaction creation and ensures proper operation handling.

Closes #19

Key Changes:

  • Implemented AccountTransactionBuilder class with fluent API for transaction construction
  • Updated to use rpc import from @stellar/stellar-sdk v13 (replacing deprecated SorobanRpc)
  • Added comprehensive unit tests and integration tests
  • Updated all transaction-related logic to work with the new SDK structure
  • Fixed type imports and RPC client initialization

Features:

  • Fluent builder API for adding operations to transactions
  • Built-in transaction signing support
  • Automatic transaction submission to Soroban RPC
  • Error handling and transaction result parsing
  • Support for all standard Stellar operations

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • ♻️ Code refactoring
  • ✅ Test addition/improvement

Security Impact

  • This change involves cryptographic operations
  • This change affects account validation logic
  • This change modifies smart contracts
  • This change handles user private keys
  • This change affects authorization/authentication
  • No security impact

The transaction builder provides a convenience layer but does not modify core security logic. All cryptographic operations are handled by the underlying Stellar SDK.

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed

Test Coverage

  • Unit tests: Comprehensive coverage of builder methods and transaction construction
  • Integration tests: End-to-end transaction submission flow
  • All tests passing with Jest 30.2.0

Manual Testing Steps

  1. Created test account and funded via Friendbot
  2. Built transactions using the new builder API
  3. Verified transaction submission to Soroban testnet
  4. Confirmed proper error handling for failed transactions
  5. Validated RPC response parsing

Breaking Changes

  • This PR introduces breaking changes

No breaking changes. This is a new feature addition that doesn't affect existing code.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

For High-Security Changes

N/A - This is not a high-security change.

Related Issues

Part of the Ancore SDK development roadmap.
Implements transaction building utilities for account abstraction layer.

Additional Context

Implementation Details

The AccountTransactionBuilder provides:

  • Method chaining for adding multiple operations
  • Automatic source account configuration
  • Transaction signing with provided keypairs
  • RPC client integration for submission
  • Type-safe operation handling

Files Modified

  • packages/core-sdk/src/account-transaction-builder.ts - New transaction builder implementation
  • packages/core-sdk/src/__tests__/builder.test.ts - Unit tests for builder
  • packages/core-sdk/src/__tests__/integration.test.ts - Integration tests
  • Updated import statements across the codebase for SDK v13 compatibility

SDK Migration Notes

This PR uses the new rpc namespace from @stellar/stellar-sdk v13:

  • SorobanRpcrpc.Server
  • Updated type imports to match new SDK structure
  • All tests verified working with SDK v13

Reviewer Notes

Focus Areas:

  1. Review builder API design for usability and clarity
  2. Verify proper error handling in transaction submission
  3. Check test coverage for edge cases
  4. Confirm SDK v13 compatibility throughout

Testing Priority:
The integration tests demonstrate real transaction submission to testnet. Please verify they pass in your environment.

Questions for Review:

  • Is the builder API intuitive for developers?
  • Are there additional operations that should be supported?
  • Should we add more helper methods for common transaction patterns?

@wheval wheval merged commit 75106c1 into ancore-org:main Feb 26, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue #4: Create Transaction Builder Wrapper for Account Abstraction

2 participants